using System.Net.Mail;

namespace EmailGateway
{
    public class SmtpGateway : IEmailGateway
    {
        private readonly string host;
        private readonly string fromAdress;

        public SmtpGateway(string host, string fromAdress)
        {
            this.host = host;
            this.fromAdress = fromAdress;
        }

        public void SendEmail(string toAdress, string subject, string body)
        {
            var smtpHost = new SmtpClient(host);

            smtpHost.Send(fromAdress, toAdress, subject, body);
        }
    }
}